<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns="http://www.w3.org/1999/xhtml" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://www.purl.org/dc/elements/1.1" xmlns:xd="http://code.google.com/speckdoc/files/xsltdoc" exclude-result-prefixes="xd rdf dc">

<rdf:Description about="http://speckdoc.googlecode.com/files/bigspeck.xsl">
<dc:Title>bigspeck.xsl</dc:Title>
<dc:Creator>http://code.google.com/gooroo</dc:Creator>
<dc:Publisher>XML Hell, Co.</dc:Publisher>
<dc:Contributor>Samuel Richter</dc:Contributor>
<dc:Date>November 25, 2008</dc:Date>
<dc:Type>Software</dc:Type>
<dc:Identifier>XMLHELL-SPECKDOC-XSL-BIGSPECK</dc:Identifier>
<dc:Description>An XSLT stylesheet that transforms speckdoc documents into HTML.</dc:Description>
<xd:version>0.1</xd:version>
<xd:versionNote>This is the initial version</xd:versionNote>
<xd:rules>none</xd:rules>
<xd:output>HTML</xd:output>
</rdf:Description>

<rdf:Description ID="t_speckdoc">
<xd:template match="speckdoc">
<xd:description>The root template of the stylesheet; renders the html, head, title and body tags, prints version number and title.</xd:description>
</xd:template>
</rdf:Description>

<xsl:template match="speckdoc">
<html>
  <head>
    <link rel="stylesheet" type="text/css" href="../speckdoc/goody.css"/>
    <title><xsl:value-of select="title"/>-Specification Documentation</title>
  </head>
  <body>
    <h1><xsl:value-of select="title"/></h1>
		<h2>version <xsl:value-of select="version/@major"/>.<xsl:value-of select="version/@minor"/><xsl:value-of select="version"/></h2>
		<xsl:apply-templates/>
  </body>
</html>
</xsl:template>

<rdf:Description ID="t_title">
<xd:template match="title">
<xd:description>Template for the title tag.  Supresses default output.  Title printed in speckdoc template.</xd:description>
</xd:template>
</rdf:Description>
<xsl:template match="title">
<!-- Suppress output -->
</xsl:template>

<rdf:Description ID="t_version">
<xd:template match="version">
<xd:description>Template for the version tag.  Supresses default output.  Version printed in speckdoc template.</xd:description>
</xd:template>
</rdf:Description>
<xsl:template match="version">
<!-- Suppress output -->
</xsl:template>

<rdf:Description ID="t_authors">
<xd:template match="authors">
<xd:description>Template for the authors tag.  Iterates through list of authors.</xd:description>
</xd:template>
</rdf:Description>

<xsl:template match="authors">
  <h3>Authors</h3>
  <xsl:for-each select="author">
	  <xsl:value-of select="first-name"/><xsl:text> </xsl:text><xsl:value-of select="last-name"/><br/>
		<xsl:if test="affiliation"><xsl:value-of select="affiliation"/><br/></xsl:if>
		<xsl:if test="web-site"><xsl:value-of select="web-site"/><br/></xsl:if>
		<xsl:if test="email"><xsl:value-of select="email"/><br/></xsl:if>
    <br/>		
  </xsl:for-each>
</xsl:template>

<rdf:Description ID="t_overview">
<xd:template match="overview">
<xd:description>Template for the overview tag.  Formats overview.</xd:description>
</xd:template>
</rdf:Description>

<xsl:template match="overview">
  <h3>Overview</h3>
	<xsl:apply-templates/>
</xsl:template>

<rdf:Description ID="t_project-ref">
<xd:template match="project-ref">
<xd:description>Template for the project-ref tag.  Formats as a span with class="project-ref"</xd:description>
</xd:template>
</rdf:Description>

<xsl:template match="project-ref">
  <span class="project-ref"><xsl:value-of select="."/></span>
</xsl:template>

<rdf:Description ID="t_motivation">
<xd:template match="motivation">
<xd:description>Template for the motivation tag.  Formats the motivation section.</xd:description>
</xd:template>
</rdf:Description>

<xsl:template match="motivation">
  <h3>Motivation</h3>
	<xsl:apply-templates/>
</xsl:template>

<rdf:Description ID="t_scope">
<xd:template match="scope">
<xd:description>Template for the scope tag.  Formats the scope section.</xd:description>
</xd:template>
</rdf:Description>

<xsl:template match="scope">
  <h3>Scope</h3>
	<xsl:apply-templates/>
</xsl:template>

<rdf:Description ID="t_technology">
<xd:template match="technology">
<xd:description>Template for the technology tag.  Formats the technology section.</xd:description>
</xd:template>
</rdf:Description>

<xsl:template match="technology">
  <h3>Technology</h3>
	<xsl:apply-templates/>
</xsl:template>

<rdf:Description ID="t_components">
<xd:template match="components">
<xd:description>Template for the title tag.  Formats the components section.</xd:description>
</xd:template>
</rdf:Description>

<xsl:template match="components">
  <h3>Components</h3>
	<xsl:apply-templates/>
</xsl:template>

<rdf:Description ID="t_details">
<xd:template match="details">
<xd:description>Template for the details tag.  Formats the details section.</xd:description>
</xd:template>
</rdf:Description>

<xsl:template match="details">
  <h3>Details</h3>
	<xsl:apply-templates/>
</xsl:template>

<rdf:Description ID="t_section">
<xd:template match="section">
<xd:description>Template for the section tag.  Formats a section block.</xd:description>
</xd:template>
</rdf:Description>

<xsl:template match="section">
  <xsl:apply-templates mode="section"/>
</xsl:template>

<rdf:Description ID="t_title#section">
<xd:template match="title" mode="section">
<xd:description>Template for the title within a section block.  Formats the section title.</xd:description>
</xd:template>
</rdf:Description>
<xsl:template match="title" mode="section">
  <h4><xsl:value-of select="."/></h4>
</xsl:template>

<rdf:Description ID="t_p#section">
<xd:template match="p" mode="section">
<xd:description>Template for the p tag.  Formats a paragraph within a section.</xd:description>
</xd:template>
</rdf:Description>

<xsl:template match="p" mode="section">
  <p><xsl:apply-templates mode="p"/></p>
</xsl:template>

<rdf:Description ID="t_tag#p">
<xd:template match="tag" mode="p">
<xd:description>Template for a tag block within a paragraph.</xd:description>
</xd:template>
</rdf:Description>

<xsl:template match="tag" mode="p">
  <xsl:apply-templates mode="tag"/>
</xsl:template>

<rdf:Description ID="t_name#tag">
<xd:template match="name" mode="tag">
<xd:description>Template for the name block of a tag block.  Formats the tag name.</xd:description>
</xd:template>
</rdf:Description>

<xsl:template match="name" mode="tag">
  <h5 class="tagname"><xsl:value-of select="."/></h5>
</xsl:template>
  
<rdf:Description ID="t_description_tag">
<xd:template match="description" mode="tag">
<xd:description>Template for the description block of a tag block.  Formats the description.</xd:description>
</xd:template>
</rdf:Description>

<xsl:template match="description" mode="tag">
  <h6>Description</h6>
  <span><xsl:apply-templates/></span>
</xsl:template>

<rdf:Description ID="t_tag-ref">
<xd:template match="tag-ref">
<xd:description>Template for the tag-ref tag.  Formats the tag-ref as a span with class="tag-ref".</xd:description>
</xd:template>
</rdf:Description>

<xsl:template match="tag-ref">
  <span class="tag-ref"><xsl:value-of select="."/></span>
</xsl:template>

<rdf:Description ID="t_attributes#tag">
<xd:template match="attributes" mode="tag">
<xd:description>Template for the attributes block within a tag block.  Formats the attributes as a new subsubsubsubsubsection.</xd:description>
</xd:template>
</rdf:Description>

<xsl:template match="attributes" mode="tag">
  <h6>Attributes</h6>
	<xsl:apply-templates/>
</xsl:template>

<rdf:Description ID="t_attribute">
<xd:template match="attribute">
<xd:description>Template for the attribute tag.</xd:description>
</xd:template>
</rdf:Description>

<xsl:template match="attribute">
  <xsl:apply-templates mode="attribute"/>
</xsl:template>

<rdf:Description ID="t_name#attribute">
<xd:template match="name" mode="attribute">
<xd:description>Template for the name block of an attribute.  Formats name as a span with class="attribute-name".</xd:description>
</xd:template>
</rdf:Description>

<xsl:template match="name" mode="attribute">
  <span class="attribute-name"><xsl:value-of select="."/>-</span>
</xsl:template>

<rdf:Description ID="t_description#attribute">
<xd:template match="description" mode="attribute">
<xd:description>Template for the description block of an attribute.  Formats as a paragraph.</xd:description>
</xd:template>
</rdf:Description>

<xsl:template match="description" mode="attribute">
  <xsl:value-of select="."/><br/>
</xsl:template>

<rdf:Description ID="t_example#tag">
<xd:template match="example" mode="tag">
<xd:description>Template for the example block of a tag.  Formats as preformatted text.</xd:description>
</xd:template>
</rdf:Description>

<xsl:template match="example" mode="tag">
  <h6>Example</h6>
	<pre class="tag-example"><xsl:value-of select="."/></pre>
</xsl:template>

<rdf:Description ID="t_error#p">
<xd:template match="error" mode="p">
<xd:description>Template for the error block of a paragraph.</xd:description>
</xd:template>
</rdf:Description>

<xsl:template match="error" mode="p">
  <xsl:apply-templates mode="error"/>
</xsl:template>

<rdf:Description ID="t_message#error">
<xd:template match="message" mode="error">
<xd:description>Template for an error message.  Formats as a div with class="error-message".</xd:description>
</xd:template>
</rdf:Description>

<xsl:template match="message" mode="error">
  <div class="error-message"><xsl:apply-templates mode="error"/></div>
</xsl:template>

<rdf:Description ID="t_unknown#error">
<xd:template match="unknown" mode="error">
<xd:description>Template for an unknown in an error.  Formats as a span with class="unknown"</xd:description>
</xd:template>
</rdf:Description>

<xsl:template match="unknown" mode="error">
  <span class="unknown"><xsl:value-of select="."/></span>
</xsl:template>

<rdf:Description ID="t_description#error">
<xd:template match="description" mode="error">
<xd:description>Template for an error description.  Formats as a div with clas="error-description".</xd:description>
</xd:template>
</rdf:Description>

<xsl:template match="description" mode="error">
  <div class="error-description"><xsl:value-of select="."/></div><br/>
</xsl:template>

<rdf:Description ID="t_markup#p">
<xd:template match="markup" mode="p">
<xd:description>Template for the markup block of a paragraph.  Formats as a preformatted block with class="markup".</xd:description>
</xd:template>
</rdf:Description>

<xsl:template match="markup" mode="p">
  <pre class="markup"><xsl:value-of select="."/></pre>
</xsl:template>

</xsl:stylesheet>

